package com.dragee.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dragee.common.PageUtils;
import com.dragee.modules.sys.dao.RoleMenuDao;
import com.dragee.modules.sys.entity.RoleMenuEntity;
import com.dragee.modules.sys.service.RoleMenuService;
import com.dragee.utils.WrapperUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service("roleMenuService")
public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuDao, RoleMenuEntity> implements RoleMenuService {


    @Resource
    private RoleMenuDao roleMenuDao;

    private String business = "roleMenu";
    /**
    * 列表
    */
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        QueryWrapper<RoleMenuEntity> wrapper = WrapperUtil.getWrapper(business, params, RoleMenuEntity.class);
        IPage<RoleMenuEntity> page = WrapperUtil.getPage(params, RoleMenuEntity.class);
        page = baseMapper.selectPage(page, wrapper.select());
        return new PageUtils(page);
    }
}